package model

import "github.com/fakeyanss/jt808-server-go/internal/codec/hex"

type Msg9105Param struct {
	ChannelNo uint8 `json:"channelNo"`
	Rate      uint8 `json:"rate"` // 丢包率
}

// Msg9105 实时音视频传输状态通知
type Msg9105 struct {
	Header *MsgHeader `json:"header"`
	Msg9105Param
}

func (m *Msg9105) Decode(packet *PacketData) error {
	return nil
}

func (m *Msg9105) Encode() (pkt []byte, err error) {
	pkt = hex.WriteByte(pkt, m.ChannelNo)
	pkt = hex.WriteByte(pkt, m.Rate)

	pkt, err = writeHeader(m, pkt)
	return pkt, err
}

func (m *Msg9105) GetHeader() *MsgHeader {
	return m.Header
}

func (m *Msg9105) GenOutgoing(incoming JT808Msg) error {
	return nil
}
